package com.biodiv.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 帖子信息表
 * @author XIE
 * @TableName post
 */
@TableName(value ="t_post")
@Data
public class Post implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 社区id：只有当帖子类型为COMMUNITY_POST和帖子类型为COMMUNITY_NOTICE时才有值
     */
    @TableField(value = "community_id")
    private Long communityId;

    /**
     * 帖子标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 消息内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 帖子图片URL数组(JSON格式)
     */
    @TableField(value = "image_url")
    private String imageUrl;

    /**
     * 点赞数
     */
    @TableField(value = "like_count")
    private Integer likeCount;

    /**
     * 评论数
     */
    @TableField(value = "comment_count")
    private Integer commentCount;


    /**
     * 评论数
     */
    @TableField(value = "view_count")
    private Integer viewCount;


    /**
     * 类型 PUBLIC_POST-公开帖子  SYSTEM_NOTICE-系统公告  COMMUNITY_POST-社区帖子  COMMUNITY_NOTICE--社区公告
     */
    @TableField(value = "type")
    private String type;

    /**
     * 标签
     */
    @TableField(value = "tag")
    private String tag;

    /**
     * 发帖时间
     */
    @TableField(value = "post_time")
    private LocalDateTime postTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标记(0:正常,1:删除)
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}